home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 8672 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  914 b 

  1. Path: interramp.com!usenet
  2. From: "James A. Clifton" <jclifton@interramp.com>
  3. Newsgroups: comp.lang.c
  4. Subject: Help referencing an array of strings
  5. Date: Tue, 05 Mar 1996 12:50:58 -0500
  6. Organization: Ethnohistory Associates
  7. Message-ID: <313C7F02.5D54@interramp.com>
  8. NNTP-Posting-Host: ip72.kalamazoo.mi.interramp.com
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=us-ascii
  11. Content-Transfer-Encoding: 7bit
  12. X-Mailer: Mozilla 2.0 (Win95; U)
  13.  
  14. I need to have an array of fixed-length strings in a structure.
  15. The problem I am having is trying to reference a particular string
  16. in the array:
  17.  
  18. typedef struct ss {
  19. /* some other data */
  20. char sa[N][M];
  21. } ss;
  22.  
  23. ss s;
  24.  
  25. Now how do I reference the Nth string??? 
  26.  
  27. I know how to reference the Mth character in the Nth string:
  28.  
  29. s.sa[n][m]
  30.  
  31. But not the Nth entire string, I've tryed:
  32.  
  33. s.sa[n][] and *s.sa[n] but neither works.
  34.  
  35. Post or reply to: jclifton@interramp.com
  36.  
  37. Thanks.
  38.